'''
处理父标签
'''
from urllib.request import urlopen
from bs4 import BeautifulSoup

html = urlopen("https://www.douban.com/gallery/")
bsObj = BeautifulSoup(html, "html.parser")

prevParent = bsObj.find("a", {"href": "https://www.douban.com/explore"}).parent
print(prevParent)